package org.example.controller;


import org.example.service.HystrixService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class HystrixController {

    @Resource
    private HystrixService hystrixService;

    @GetMapping("/hystrix/ok")
    public String test_ok(){
        String info = hystrixService.ok_info();
        return info;
    }

    @GetMapping("/hystrix/timeout")
    public String test_timeOut(){
        return hystrixService.timeout_info();
    }

    @GetMapping("/hystrix/circuit_break/{id}")
    public String test_circuit_break(@PathVariable Integer id){
        return hystrixService.circuit_break(id);
    }
}
